Dual Write Issue

Problem:

Initial sync issue for CDS Sales Order Line entity in D365FO Dual Write to CRM.

Explanation:

While synchronizing the CDS Sales Order Header entity to CRM through Dual Write, all the sales order header details have been synchronized.

After the header synchronization, triggering the initial synchronization of CDS Sales Order Line entity throws errors:

Error Screenshot

When the sales order header is set to Invoiced, it cannot be edited. Therefore, sales order line details of invoiced headers are not synchronized to CRM.

Solution:

STEP 1:

Go to the CDS Sales Order Header entity, remove the SalesOrderProcessingStatus field from the mapping. Save the entity with a new version and trigger the initial synchronization of CDS Sales Order Header entity.

Step 1

Now all the sales order header details will be synchronized to CRM, and in CRM, the SalesStatus field will be set to Active.

Step 1 Result

STEP 2:

Once the initial synchronization of CDS Sales Order Header entity is completed, trigger the initial synchronization of CDS Sales Order Line entity.

All sales order line details will now be synchronized to CRM because the SalesOrderProcessingStatus field is set to Active.

Step 2

STEP 3:

Once the initial synchronization of CDS Sales Order Line entity is completed, go back to the CDS Sales Order Header entity and roll back to the old version with the SalesStatus field mapped. Then trigger the initial synchronization of CDS Sales Order Header entity again.

Step 3

After this, the SalesOrderProcessingStatus field will be set to its respective status.

Step 3 Result